package com.wty.gw.service;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.wty.gw.util.PageParamReq;
import com.wty.gw.dao.CommonSlideMapper;
import com.wty.gw.model.Do.CommonSlideDO;
import com.wty.gw.model.query.CommonSlideQuery;
import com.wty.gw.service.CommonSlideService;
import com.wty.gw.model.vo.CommonSlideVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Date;

@Service
public class CommonSlideServiceImpl implements CommonSlideService{

	@Autowired
    private CommonSlideMapper commonSlideMapper;

    @Override
    public void add(CommonSlideDO commonSlideDo) {
        commonSlideMapper.insert(commonSlideDo);
    }

    @Override
    public void delete(Long id) {
        commonSlideMapper.deleteByPrimaryKey(id);
    }

    @Override
    public void update(CommonSlideDO commonSlideDo) {
        commonSlideMapper.updateByPrimaryKeySelective(commonSlideDo);
    }

    @Override
    public PageInfo<CommonSlideVo> listByPage(CommonSlideQuery commonSlideQuery) {
        PageHelper.startPage(commonSlideQuery.getPageNo(), commonSlideQuery.getPageSize());

        return new PageInfo(commonSlideMapper.listBycompanyId(commonSlideQuery));
    }

    @Override
    public CommonSlideDO get(Long id) {
        return commonSlideMapper.selectByPrimaryKey(id);
    }
	
	
	
	
	
	
}